set(LIB_NAME cmw_app)

find_package(OpenCV  REQUIRED)
find_package(CUDA REQUIRED)
aux_source_directory(. DIR_LIB_SRCS)
include_directories(
    ${PROJECT_SOURCE_DIR}/include
    ${Opencv_INCLUDE_DIRS}
    ${CUDA_INCLUDE_DIRS}
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/detection_vision>
    $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src/detection_vision>
    $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
)

add_library(${LIB_NAME} SHARED ${DIR_LIB_SRCS})

set_target_properties (${LIB_NAME} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties (${LIB_NAME} PROPERTIES VERSION 1.0 SOVERSION 1)
target_link_libraries(${LIB_NAME} ${OpenCV_LIBS}   ${CUDA_LIBRARIES} sgm ctdet detection)

set(CMAKE_STAGING_PREFIX /opt/adc)
install(TARGETS ${LIB_NAME}
  ARCHIVE DESTINATION ${CMAKE_STAGING_PREFIX}/lib
  LIBRARY DESTINATION ${CMAKE_STAGING_PREFIX}/lib
 # RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)


